﻿@page "/"

@code
{
    string text = "";
    List<TreeItem> Items = new List<TreeItem>();

    protected override void OnInitialized()
    {
        TreeItem tiParent = new TreeItem() { Text = "parent", };
        TreeItem tiChild = new TreeItem() { Text = "child", };
        tiParent.Items.Add(tiChild);
        Items.Add(tiParent);
    }

    private Task OnTreeItemClick(TreeItem item)
    {
        text = item.Text;
        StateHasChanged();
        return Task.CompletedTask;
    }

}

<h1>Hello, world!</h1>


<Tree Items="@Items" OnTreeItemClick="@OnTreeItemClick" />
<Textarea Value="@text"></Textarea>
